<template>
  <div id="app" 
    :class="currentRoute == '/' ? 'index' : ''"
    :style="currentRoute == '/' ? `background-image:url(${require('images/body-bg.jpg')})` : ''">
    <g-header :path="currentRoute"/>
    <div id="main" >
      <nuxt/>
    </div>
    <g-footer :path="currentRoute"/>
  </div>
</template>

<script>

export default {
  name: 'Default',
  created () {
    this.currentRoute = this.$route.path
  },
  data () {
    return {
      currentRoute: ''
    }
  },
  watch: {
    '$route.path' (newval) {
      this.currentRoute = newval
    }
  }
}
</script>

<style lang="scss" scope>
#app {
  &.index{
    overflow: hidden;
    background-position: center center;
    #footer {
      background: none;
      color: #000;
      a {
        color: inherit;
      }
    }
  }
}
.page-enter-active,
.page-leave-active {
  transition: opacity 0.2s;
}
.page-enter,
.page-leave-to {
  opacity: 0;
}
</style>